package org.csu.laboratoryequipment.service.impl;

import org.csu.laboratoryequipment.common.CommonResponse;
import org.csu.laboratoryequipment.entity.Manager;
import org.csu.laboratoryequipment.persistence.ManagerMapper;
import org.csu.laboratoryequipment.service.ManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("ManagerService")
public class ManagerServiceImpl implements ManagerService {

    @Autowired
    private ManagerMapper managerMapper;
    public CommonResponse login(String username, String password) {
       Manager manager = managerMapper.findByUsernameAndPassword(username, password);
       if (manager==null){
           return CommonResponse.createForError(1);
       }else {
           return CommonResponse.createForSuccess(0);
       }
    }
}
